import qs from "qs"
import request from "@/API/request";
// 退出登录
export const logoutAPI = () =>
  request.post("/prod-api/logout");
// 用户管理左边树状请求
export const treeselectAPI = () => request.get("/prod-api/system/dept/treeselect")
// 用户管理数据
export const userListApi = (params) => request.get(`/prod-api/system/user/list`, {params} );
// 用户管理搜索
export const  searchUserListApi = (params) => request.get(`/prod-api/system/user/list?${qs.stringify(params)}` );
// 岗位和角色数据请求
export const userAPI = () => request.get("/prod-api/system/user/")
// 添加用户
export const addUserAPI = (params) => request.post("/prod-api/system/user",params)
// 获取修改用户信息
export const getEditUserAPI = (id) => request.get(`/prod-api/system/user/${id}`)
// 删除用户
export const deleteUserAPI = (id) => request.delete(`/prod-api/system/user/${id}`)
// 批量删除
export const deleteUsersAPI = (id) => request.delete(`/prod-api/system/user/${id.join(',')}`)
// 修改用户
export const editUserAPI = (params) => request.put('/prod-api/system/user',params)
// 重置密码
export const resetPwdAPI = (params) => request.put('/prod-api/system/user/resetPwd',params)
// 获取分配角色信息
export const getAuthRoleAPI = (id) => request.get(`/prod-api/system/user/authRole/${id}`,)
// 分配角色
export const authRoleAPI = (userId,roleIds) => request.put(`/prod-api/system/user/authRole?userId=${userId}&roleIds=${roleIds}`)
// 修改状态
export const changeStatusAPI = (params) => request.put("/prod-api/system/user/changeStatus",params)
// 导入
export const importDataAPI = (params) => request.post("/prod-api/system/user/importData",qs.stringify(params))
// 导出
export const exportAPI = (params) => request.post("/prod-api/system/user/export",params)


// 收入报表数据
export const storeincomeAPI = (params) => request.get('/prod-api/report/storeincome', {params} );
// 收入报表搜索
export const searchStoreIncomeAPI = (params) => request.get(`/prod-api/report/storeincome?${qs.stringify(params)}`);
// 消费单报表数据
export const shopConsumptionAPI = (params) => request.get('/prod-api/report/shopConsumption', {params} );
// 消费单报表数据搜索
export const searchShopConsumptionAPI = (params) => request.get(`/prod-api/report/shopConsumption?${qs.stringify(params)}`);
// 消费单报表数据
export const customerConsumeReportAPI = (params) => request.get('/prod-api/report/customerConsumeReport', {params} );
// 消费单报表数据搜索
export const searchCustomerConsumeReportAPI = (params) => request.get(`/prod-api/report/customerConsumeReport?${qs.stringify(params)}`);
// export const searchCustomerConsumeReportAPI = (params) => request.get(`/prod-api/report/customerConsumeReport`,{params});

// 套餐信息
export const carPackageAuditAPI = (params) => request.get('/prod-api/business/carPackageAudit', {params} );
// 套餐信息搜索
export const searchCarPackageAuditAPI = (params) => request.get('/prod-api/business/carPackageAudit', {params} );
// 获取审核历史信息
export const getHistoryAPI = (instanceId) => request.get(`/prod-api/business/carPackageAudit/history/${instanceId}`)
// 获取流程进度图信息
export const getProcessAPI = (id) => request.get(`/prod-api/business/carPackageAudit/process/${id}`)
// 撤销套餐
export const cancelAPI = (id) => request.delete(`/prod-api/business/carPackageAudit/cancel/${id}`)
// 我的代办
export const todoAPI = (params) => request.get('/prod-api/business/carPackageAudit/todo', {params} );